<?php

/**
 * institucionEmpresa form base class.
 *
 * @method institucionEmpresa getObject() Returns the current form's model object
 *
 * @package    sistema_itec_new
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseinstitucionEmpresaForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'                    => new sfWidgetFormInputHidden(),
      'nombre'                => new sfWidgetFormInputText(),
      'etiqueta'              => new sfWidgetFormInputText(),
      'observaciones'         => new sfWidgetFormInputText(),
      'domicilio'             => new sfWidgetFormInputText(),
      'telefono_fijo'         => new sfWidgetFormInputText(),
      'telefono_fax'          => new sfWidgetFormInputText(),
      'cuit'                  => new sfWidgetFormInputText(),
      'email'                 => new sfWidgetFormInputText(),
      'institucion_educativa' => new sfWidgetFormInputText(),
      'propia'                => new sfWidgetFormInputText(),
      'sitio_web'             => new sfWidgetFormInputText(),
      'rubro_id'              => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Rubro'), 'add_empty' => false)),
      'gestion_id'            => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Gestion'), 'add_empty' => false)),
      'localidad_id'          => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Localidad'), 'add_empty' => false)),
      'estado_id'             => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Estado'), 'add_empty' => false)),
    ));

    $this->setValidators(array(
      'id'                    => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id')), 'empty_value' => $this->getObject()->get('id'), 'required' => false)),
      'nombre'                => new sfValidatorString(array('max_length' => 100)),
      'etiqueta'              => new sfValidatorString(array('max_length' => 10, 'required' => false)),
      'observaciones'         => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'domicilio'             => new sfValidatorString(array('max_length' => 100)),
      'telefono_fijo'         => new sfValidatorString(array('max_length' => 15, 'required' => false)),
      'telefono_fax'          => new sfValidatorString(array('max_length' => 15, 'required' => false)),
      'cuit'                  => new sfValidatorString(array('max_length' => 15)),
      'email'                 => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'institucion_educativa' => new sfValidatorInteger(),
      'propia'                => new sfValidatorInteger(),
      'sitio_web'             => new sfValidatorString(array('max_length' => 100, 'required' => false)),
      'rubro_id'              => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Rubro'))),
      'gestion_id'            => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Gestion'))),
      'localidad_id'          => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Localidad'))),
      'estado_id'             => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Estado'))),
    ));

    $this->widgetSchema->setNameFormat('institucion_empresa[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'institucionEmpresa';
  }

}
